package com.wr.hangzhounewlight.controller;

import com.wr.hangzhounewlight.obj.api.orderclosed.OrderClosedRequest;
import com.wr.hangzhounewlight.obj.api.orderclosed.OrderClosedResponse;
import com.wr.hangzhounewlight.service.OrderClosedService;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author yuanzhizhuo
 * createDate 2025/10/23
 */
@CrossOrigin
@RestController
@AllArgsConstructor
public class OrderClosedController {

    private final OrderClosedService service;

    /**
     * 组合订单关闭
     *
     * @param request dto
     * @return 是否关闭成功
     */
    @PostMapping("/order-closed")
    public OrderClosedResponse orderClosed(@RequestBody OrderClosedRequest request) {
        return service.orderClosed(request);
    }

}
